<?php
$response=array();
require_once('db_config.php');

/* Open a connection */
$mysqli = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);

$query="select * from dmstt";

if($record=$mysqli->query($query))
{
	$response["success"]=1;
	$response["data"]=array();
	while ($row = $record->fetch_assoc()) 
	{
		$stt=array();
		$stt["ma"]=$row["Ma"];
		$stt["giatri"]=$row["giatri"];

		array_push($response["data"], $stt);		
	}
	$record->close();
}
else
{
	$response["success"]=0;
	$response["error"]="error when execute query";
}
$mysqli->close();

echo json_encode($response);
?>